package subject

import (
	"vrcm/src/vrcm/common/models"
)

type Subject struct {
	models.Model

	SubjectName  string `json:"subject_name" gorm:"type:varchar(100);comment:题目名称"`
	SubjectTitle string `json:"subject_title" gorm:"type:varchar(255);comment:题干"`
	TitleImg     string `json:"title_img" gorm:"type:varchar(500);comment:题目图片"`
	//EventId      string `json:"event_id" gorm:"type:varchar(35);comment:活动id"`
	//TenantId     string `json:"tenant_id" gorm:"type:varchar(50);comment:租户id"`
	PaperId      int `json:"paper_id" gorm:"type:int;comment:试卷id"`
	ChooseType   int `json:"choose_type" gorm:"type:tinyint;comment:选择类型1.单选 2.多选"`
	SubjectType  int `json:"subject_type" gorm:"type:tinyint;comment:题目类型 1.不含图片 2.含图片"`
	ExpiryTime   int `json:"expiry_time" gorm:"type:int;comment:题目时长"`
	MaxChooseNum int `json:"max_choose_num"  gorm:"type:int;comment:最大选择个数"`
	//Option       string `json:"option" gorm:"type:varchar(500);comment:选项"`
	Answer   string `json:"answer" gorm:"type:varchar(200);comment:答案"`
	IsDelete int    `json:"is_delete" gorm:"type:tinyint;comment:是否删除 1删除 2未删除"`
	Desc     string `json:"desc" gorm:"type:varchar(500);comment:描述"`
	models.ModelTime
	models.ControlBy
}

func (Subject) TableName() string {
	return "subject"
}

func (e *Subject) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *Subject) GetId() interface{} {
	return e.Id
}

type SubjectWithOptions struct {
	Subject Subject         `json:"subject" comment:"题目"`
	Options []SubjectOption `json:"options" comment:"选项"`
}
